﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.Ycm20250401.Service._20250418
{
    /// <summary>
    /// 用户实体
    /// </summary>
    public record UserLogin(string UserName,string PasswordHash)
    {
        /// <summary>
        /// 验证密码是否正确
        /// </summary>
        /// <param name="validatePassword"></param>
        /// <returns></returns>
        public async Task<bool> PasswordIsValid(IValidatePassword validatePassword,string password)
        {
            return await validatePassword.ValidatePassword(password, PasswordHash);
        }
    }
}
